<template>
  <form-item :form-datas = "formDatas" :form-item = "field" :parent-comp-type = "parentCompType"
  >
    <el-upload
        :accept = "field.preps['accept']"
        :action = "field.preps['action']"
        :auto-upload = "field.preps['autoUpload']"
        :before-remove = "field.preps['beforeRemove']"
        :before-upload = "field.preps['beforeUpload']"
        :data = "field.preps['data']"
        :disabled = "field.preps['disabled']"
        :drag = "field.preps['drag']"
        :headers = "field.preps['headers']"
        :http-request = "field.preps['httpRequest']"
        :limit = "field.preps['limit']"
        :list-type = "field.preps['listType']"
        :method = "field.preps['method']"
        :multiple = "field.preps['multiple']"
        :name = "field.preps['name']"
        :on-change = "field.preps['onChange']"
        :on-error = "field.preps['onError']"
        :on-exceed = "field.preps['onExceed']"
        :on-preview = "field.preps['onPreview']"
        :on-progress = "field.preps['onProgress']"
        :on-remove = "field.preps['onRemove']"
        :on-success = "field.preps['onSuccess']"
        :show-file-list = "field.preps['showFileList']"
        :with-credentials = "field.preps['withCredentials']"
        v-model:file-list = "dataField"

    >
      <user-icon icon = "plus-circle" style = "color:#e3e9f2;"/>
    </el-upload>
  </form-item>
</template>

<script>
import FormItem from "./form-item";

export default {
  name: "upload-item",
  components: {FormItem},
  props: {
    parentCompType: {type: Object},
    starHorseDynamicForm: {type: Object},
    field: {
      type: Object
    },
    formDatas: {type: Object}
  },
  data() {
    return {
      dataField: []
    }
  },
  methods: {
    selectItem(data) {
      let _this = this;
      _this.$emit("selectItem", data, _this.parentCompType);
    }
  }
}
</script>

<style scoped>

</style>